<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">

    <input type="text" v-model="user.name">
    <input type="text" v-model="user.age">

</div>

<script src="./node_modules/vue/dist/vue.js"></script>
<script>

    var dataObj = {
        searchkey2: "",
        user: {
            name: "zhangsan",
            age: 19
        }
    };


    var vm = new Vue({
        el: "#app",   //el，element：即要渲染的页面元素
        data: dataObj,
        watch: {
            searchkey2: function (a, b) {
                console.log(a + "," + b);
            },
            /*深度监控对象*/
            user: {
                deep:true,
                handler(a){
                    console.log(a);
                }
            }
        }
    });
</script>
</body>
</html>